<?php
include('../classes/class.Connection.php');
$log = new User();
$log->username = $_POST['username'];
$log->password = $_POST['password'];

if($log->username == '' || $log->password == ''){
     echo "<div class='corner-all error padding-all margin-top font12'>Please enter your username and password.</div>";
}
else{
    if($log->login() == true){
        echo "<div class='corner-all success padding-all margin-top font12'>Successfully log in.</div>";
        echo "
            <script language='javascript'>
               $(document).ready(function(){
                   
                   window.location = 'admin';
                    
                });
            </script>
            ";
    }
    else{
        echo "<div class='corner-all error padding-all margin-top font12'>Please enter a valid username and password.</div>";
        
    }
}


?>
